<template>
<view class="container">
  <view class="row" @click="gopage('page_work/user/setUserInfo')">
    <view>账号设置</view>
    <uni-icons type="forward" size="18" class="arrow" color="#010812"></uni-icons>
  </view>
  <view class="row" @click="gopage('page_work/user/userCollection')">
    <view>持股人收款信息</view>
    <view class="right">
      <view :class="statusClass">{{ statusText }}</view>
      <uni-icons type="forward" size="18" class="arrow" color="#010812"></uni-icons>
    </view>
  </view>
  <view class="row" @click="lineSign">
    <view>实名认证</view>
    <view class="right">
      <view :class="authStatusClass">{{ authStatusText }}</view>
      <uni-icons type="forward" size="18" class="arrow" color="#010812"></uni-icons>
    </view>
  </view>
  <view class="row" @click="gopage('page_work/user/warehouse')">
    <view>我的仓储</view>
    <uni-icons type="forward" size="18" class="arrow" color="#010812"></uni-icons>
  </view>
<!--  <view class="row" @click="gopage('page_work/taskList/index')">-->
<!--    <view>我的合同</view>-->
<!--    <uni-icons type="forward" size="18" class="arrow" color="#010812"></uni-icons>-->
<!--  </view>-->
  <view class="row">
    <view>版本信息</view>
    <view class="right">V1.0.0</view>
<!--    <uni-icons type="forward" size="18" class="arrow" color="#010812"></uni-icons>-->
  </view>
</view>
</template>

<script>
import authMixins from "@/common/authSignTask.mixins.js";
export default {
  data(){
    return {
      status:0,
      authStatus:false
    }
  },
  mixins: [authMixins],
  computed:{
    statusClass(){
      switch (this.status) {
        case 1:
          return 'warn'
        case 2:
          return 'success'
        case 3:
          return 'fail'
        default:
          return 'fail'
      }
    },
    statusText(){
      switch (this.status) {
        case 1:
          return '审核中'
        case 2:
          return '审核通过'
        case 3:
          return '驳回'
        default:
          return '未设置'
      }
    },
    authStatusClass(){
      switch (this.authStatus) {
        case true:
          return 'success'
        default:
          return 'fail'
      }
    },
    authStatusText(){
      switch (this.authStatus) {
        case true:
          return '已认证'
        default:
          return '未认证'
      }
    },
  },
  mounted(){
  },
  onShow(){
    this.getAccount()
    this.auth()
  },
  methods:{
    async auth(){
      this.authStatus = await this.getAuthStatus();
    },
    lineSign(){
      !this.authStatus && this.onlineSign()
    },
    gopage(url,options){
      this.$navTo(url,options)
    },
    getAccount(){
      const params = {}
      this.$request.get('wx/account/detail',params).then(({data}) => {
        this.status = data.status
      }).catch(err=>{
        this.$toast(err.errmsg)
      })
    }
  },

}
</script>

<style scoped lang="scss">
.container{
  width: 100%;
  height: 100%;
  min-height: 100vh;
  background-color: #f7f7f7;
  box-sizing: border-box;
  padding: 40rpx;
  .row{
    border-radius: 10rpx;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding:30rpx 20rpx;
    box-sizing: border-box;
    font-size: 32rpx;
    font-weight: 500;
    color: #010812;
    margin-bottom: 30rpx;
    .right{
      font-size: 26rpx;
      font-weight: 400;
      color: #000000;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 12rpx;
    }
    //警告
    .warn{
      font-size: 26rpx;
      font-weight: 400;
      color: #eec543;
    }
    //成功
    .success{
      font-size: 26rpx;
      font-weight: 400;
      color: #24e026;
    }
    //失败
    .fail{
      font-size: 26rpx;
      font-weight: 400;
      color: #FB1F1E;
    }
  }
}
</style>